package org.zjx.indetify;

import org.zjx.resource.GameRes;
import org.zjx.resource.ResourceManager;

import java.awt.image.BufferedImage;

public class IdentifyErrorManager {
    private static final String identifyResultTag = "identifyResult";

    public static BufferedImage getImage(String classify, String fileName) {
        return GameRes.getInstance().loadImage(GameRes.RES_ERROR, classify, fileName);
    }

    public static void saveImage(BufferedImage image, String classify, String fileName) {
        if (ResourceManager.CONFIG != null && !ResourceManager.CONFIG.isRecordIdentifyError()) return;
        GameRes.getInstance().saveImage(image,GameRes.RES_ERROR, classify, fileName);
    }

    public static void saveIdentifyFontErrorImage(BufferedImage image) {
        saveImage(image,"fontImage",String.valueOf(System.currentTimeMillis()));
    }

    public static void saveIdentifyPropErrorImage(BufferedImage image) {
        saveImage(image,"propImage",String.valueOf(System.currentTimeMillis()));
    }
}
